package com.dj.portal.web;


import com.dj.portal.pojo.po.Picture;
import com.dj.portal.pojo.po.User;
import com.dj.portal.service.PictureService;
import com.qf.common.util.PropKit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class PictureAction {


    @Autowired
    private PictureService pictureService;

    @RequestMapping("/user/lunbo")
    public String PriturePid(HttpServletRequest request,User u){
        Long pid = PropKit.use("index.properties").getLong("lunbo.pid");
        List<Picture> pictureList = pictureService.getPicturePid(pid);
        request.setAttribute("pictureList",pictureList);
        List<User> userList = pictureService.selectByuid(u);
        request.setAttribute("userList",userList);
        return  "/user/lunbo";
    }

/*
    @RequestMapping("/user/lunbo")
    public String SelectByUid(HttpServletRequest request, Long uid){
         User user = pictureService.selectByuid(uid);
         request.setAttribute("user",user);
         System.out.println(user);
        return "/user/lunbo";
    }*/
}
